package com.oplink.webems.modules.log.aop;

import java.util.HashMap;
import java.util.Map;

import com.oplink.webems.modules.alarm.service.AlarmCurrentService;
import com.oplink.webems.modules.alarm.service.AlarmHistoryService;
import com.oplink.webems.modules.alarm.service.AlarmPropService;
import com.oplink.webems.modules.cfg.services.CfgCardService;
import com.oplink.webems.modules.cfg.services.CfgNeService;
import com.oplink.webems.modules.cfg.services.CfgNetypeService;
import com.oplink.webems.modules.cfg.services.CfgSeverityService;
import com.oplink.webems.modules.cfg.services.CfgSiteService;
import com.oplink.webems.modules.cfg.services.CfgSlotService;
import com.oplink.webems.modules.log.service.CommLogService;
import com.oplink.webems.modules.log.service.UserLogService;
import com.oplink.webems.modules.sys.service.AccountService;
import com.oplink.webems.modules.sys.service.DictService;
import com.oplink.webems.modules.sys.service.ShiroDbRealm;
import com.oplink.webems.modules.topo.service.TopoService;

public class AopModulesConstant {
	public final static int NOAOPED = 1;
	public final static int TOPO = 2;
	public final static int ALARM = 3;
	public final static int LOG_USER = 4;
	public final static int LOG_COMM = 401;
	
	public final static int ALARM_HIS = 301;
	public final static int ALARM_PROP = 302;
	
	public final static int CFG_SITE = 5;
	public final static int CFG_NE = 501;
	public final static int CFG_CARD = 502;
	public final static int CFG_SLOT = 503;
	public final static int CFG_SEVERITY = 504;
	public final static int CFG_NETYPE = 505;
	
	@SuppressWarnings("rawtypes")
	public static Map<Class , Integer> modules = new HashMap<Class, Integer>(){
		private static final long serialVersionUID = 4349892311022761847L;
		{
			put(TopoService.class, TOPO);
			put(AlarmCurrentService.class, ALARM);
			put(AlarmHistoryService.class, ALARM_HIS);
			put(AlarmPropService.class, ALARM_PROP);
			put(AccountService.class, NOAOPED);
			put(ShiroDbRealm.class, NOAOPED);
			put(DictService.class, NOAOPED);
			put(UserLogService.class, NOAOPED);
			put(CommLogService.class, NOAOPED);
			put(CfgSiteService.class, CFG_SITE);
			put(CfgNeService.class, CFG_NE);
			put(CfgCardService.class, CFG_CARD);
			put(CfgSlotService.class, CFG_SLOT);
			put(CfgSeverityService.class, CFG_SEVERITY);
			put(CfgNetypeService.class, CFG_NETYPE);
		}
	};
	
	@SuppressWarnings("rawtypes")
	public static int getModuleCode (Class c){
		Integer code = modules.get(c);
		return code==null?1:code.intValue();
	}
}
